<template>
	<view class="pages">
		<h-nav-bar fixed title="常用问卷"></h-nav-bar>
		<up-sticky>
			<view class="head">
				<view class="head_s">
					<image class="head_s_img" src="@/static/patient/search.png"></image>
					<view class="head_s_text">请输入问卷名称</view>
				</view>
				<view class="head_nav">
					<view class="head_nav_l" @click="">
						<view class="head_nav_l_t" :style="{ color: (search.order_status==0 ? '#333333' : '#999999') }">默认</view>
					</view>
					<view class="head_nav_l" @click="checkEar">
						<view class="head_nav_l_t">发布时间</view>
						<template v-if="search.order_status!=1">
							<image class="head_nav_l_r_t" src="/static/common/wa.png" />
							<image class="head_nav_l_r_b" src="/static/common/xa.png" />
						</template>
						<template v-else>
							<template v-if="search.order_value=='asc'">
								<image class="head_nav_l_r_t" src="/static/common/tb.png" />
								<image class="head_nav_l_r_b" src="/static/common/xa.png" />
							</template>
							<template v-if="search.order_value=='desc'">
								<image class="head_nav_l_r_t" src="/static/common/wa.png" />
								<image class="head_nav_l_r_b" src="/static/common/xa.png" />
							</template>
						</template>
					</view>
					<view class="head_nav_l" @click="checkInv">
						<view class="head_nav_l_t">收集数量</view>
						<template v-if="search.order_status!=2">
							<image class="head_nav_l_r_t" src="/static/common/wa.png" />
							<image class="head_nav_l_r_b" src="/static/common/xa.png" />
						</template>
						<template v-else>
							<template v-if="search.order_value=='asc'">
								<image class="head_nav_l_r_t" src="/static/common/tb.png" />
								<image class="head_nav_l_r_b" src="/static/common/xa.png" />
							</template>
							<template v-if="search.order_value=='desc'">
								<image class="head_nav_l_r_t" src="/static/common/wa.png" />
								<image class="head_nav_l_r_b" src="/static/common/xa.png" />
							</template>
						</template>
					</view>
				</view>
			</view>
		</up-sticky>
		
	</view>
</template>

<script setup lang="ts">
	import { ref } from 'vue'
	import { navigateBack, navigateTo, formatDate, showToast } from '@/utils'
	import { onLoad, onPageScroll, onShow, onReady } from '@dcloudio/uni-app'
	const tops = ref(0)
	const bottoms = ref(0)
	//保存参数
	const params = ref({
		type:0,
		type_value:"",
		page:1,
		limit:10
	})
	onLoad((o) => {

	})
	onShow(() => {})
	onReady(() => {
		uni.getSystemInfo({
			success: (e) => {
				tops.value = e.statusBarHeight * 2
				bottoms.value = e.safeAreaInsets.bottom * 2
			}
		})
	})
	
	function checkEar() {
		var val = search.value.type;
		is_default.value = false
		if(val != 1) {
			search.value.order_status = 1
			search.value.type_value = 'asc'
		} else {
			if(search.value.type_value == 'asc') {
				search.value.type_value = 'desc'
			} else {
				search.value.type_value = 'asc'
			}
		}
		search.value.page = 1
		itemList.value = []
		getList()
	}
</script>

<style lang="scss" scoped>
	.pages {
		width: 750rpx;
		min-height: 100vh;
		background: #F5F6F8;
	}
</style>